home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="generator" content="amaya 5.4, see http://www.w3.org/Amaya/" />
- <title>About White Space Handling</title>
- <style type="text/css">
- </style>
- <link href="../style.css" rel="stylesheet" type="text/css" />
- </head>
-
- <body xml:lang="en" lang="en">
-
- <table border="0" summary="toc">
- <tbody>
- <tr>
- <td><img alt="W3C" src="../../images/w3c_home" /> <img alt="Amaya"
- src="../../images/amaya.gif" /></td>
- <td><p><a href="about_standard_multikey_support.html"
- accesskey="p"><img alt="previous" src="../../images/left.gif" /></a>
- <a href="../EditChar.html" accesskey="t"><img alt="top"
- src="../../images/up.gif" /></a></p>
- </td>
- </tr>
- </tbody>
- </table>
-
- <div id="page_body">
- <h1>About White Space Handling</h1>
-
- <p>Amaya removes insignificant white-space characters when it loads a
- document unless they must be explicitly preserved. This is true for XHTML,
- MathML, and SVG documents, as well as MathML or SVG elements included in a
- HTML document,</p>
-
- <p>The following are considered as insignificant white-space characters:</p>
- <ul>
- <li>End of line characters (<code>#xD</code> and <code>#xA</code>)</li>
- <li>Tab characters (<code>#X9</code>)</li>
- <li>Leading spaces of an element</li>
- <li>Trailing spaces of an element</li>
- <li>Contiguous spaces (one space is preserved)</li>
- </ul>
-
- <p>To preserve all the characters for some elements, use the
- <code>xml:space</code> attribute or the <code>PRE</code> element (only valid
- for XHTML documents). The possible values for the <code>xml:space</code>
- attribute are <code>default</code> and <code>preserve</code>.</p>
- <ul>
- <li>The value <code>default</code> means that an applications' default
- white-space treatment is acceptable for these elements. In Amaya, the
- default treatment removes the insignificant white-space characters for
- all supported DTDs (see above).
- <p></p>
- </li>
- <li>The value <code>preserve</code> indicates that applications will
- preserve all the characters, except the first one that immediately
- follows the end tag of the element where it is specified, if that element
- is an end of line.</li>
- </ul>
-
- <p>You apply the <code>xml:space</code> attribute to all elements within the
- content of the element where it is specified, unless it is overriden with
- another instance of the <code>xml:space</code> attribute.</p>
-
- <p>In an XHTML DTD, the <code>PRE</code> element causes the same behavior as
- the <code>xml:space</code> attribute with the value <code>preserve</code>.</p>
-
- <p>Amaya applies white space handling when it loads a document, not during
- editing. A consequence is that if you type insignificant white-space
- characters, they will be visible and saved but will be removed the next time
- the document is loaded. For example, the following source code:</p>
-
- <p><code><p>Amaya removes the <strong> insignificant white-space
- </strong>when it loads ...</p></code></p>
-
- <p>displays as follows during editing:</p>
-
- <p><code>Amaya removes the <strong>insignificant white-space</strong> when it
- loads...</code></p>
-
- <p>The text will be saved with that syntax. However, the next time the
- document is loaded, the text will display as:</p>
-
- <p><code>Amaya removes the<strong>insignificant white-space</strong>when it
- loads...</code></p>
-
- <p>because the leading and trailing spaces of the element
- <code><strong></code> are considered to be insignificant and are
- removed.</p>
-
- <p>The correct source code would be:</p>
-
- <p><code><p>Amaya removes the <strong>insignificant
- white-space</strong> when it loads ...</p></code></p>
- </div>
- </body>
- </html>
-